package kr.or.kosta.otr.service.interestservice;

import java.sql.SQLException;
import java.util.ArrayList;
import java.util.HashMap;

import javax.annotation.Resource;

import kr.or.kosta.otr.persistence.company.CompanyDao;
import kr.or.kosta.otr.persistence.companyreview.CompanyReviewDao;
import kr.or.kosta.otr.persistence.companyreviewverify.CompanyReviewVerifyDao;
import kr.or.kosta.otr.persistence.interestcompany.InterestCompanyDao;
import kr.or.kosta.otr.persistence.interestreview.InterestReviewDao;
import kr.or.kosta.otr.persistence.user.UserDao;
import kr.or.kosta.otr.vo.CompanyReviewVO;
import kr.or.kosta.otr.vo.CompanyVO;
import kr.or.kosta.otr.vo.InterestCompanyVO;
import kr.or.kosta.otr.vo.InterestReviewVO;
import kr.or.kosta.otr.vo.TrueOrFalseVO;
import kr.or.kosta.otr.vo.UserVO;

import org.springframework.stereotype.Service;

@Service("InterestService")
public class InterestServiceImpl implements InterestService {
	@Resource(name="InterestReviewDao")
	InterestReviewDao interestReviewDao;
	
	@Resource(name="InterestCompanyDao")
	InterestCompanyDao interestCompanyDao;
	
	@Resource(name="CompanyDao")
	CompanyDao companyDao;
	
	@Resource(name="CompanyReviewDao")
	CompanyReviewDao companyReviewDao;
	
	@Resource(name="CompanyReviewVerifyDao")
	CompanyReviewVerifyDao companyReviewVerifyDao;
	
	@Resource(name="UserDao")
	UserDao userDao;

	@Override
	public void addInterestCompany(InterestCompanyVO interestCompanyVO)
			throws SQLException {
		interestCompanyDao.addInterestCompany(interestCompanyVO);
		
	}

	@Override
	public void deleteInterestCompany(int interestCompanyId)
			throws SQLException {
		interestCompanyDao.deleteInterestCompany(interestCompanyId);
		
	}

	@Override
	public ArrayList<InterestCompanyVO> getAllInterestCompany(String userId)
			throws SQLException {
		
		return interestCompanyDao.getAllInterestCompany(userId);
	}

	@Override
	public ArrayList<CompanyVO> getCompanyInfo(HashMap<String, Object> map)
			throws SQLException {
		
		return companyDao.getCompanyInfo(map);
	}

	@Override
	public CompanyVO getOneCompany(int companyId) throws SQLException {
		// TODO Auto-generated method stub
		return companyDao.getOneCompany(companyId);
	}

	@Override
	public boolean checkInterestCompany(HashMap<String, Object> map)
			throws SQLException {
		
		return interestCompanyDao.checkInterestCompany(map);
	}

	@Override
	public void addInterestReview(InterestReviewVO vo) throws SQLException {
		interestReviewDao.addInterestReview(vo);
		
	}

	@Override
	public void deleteInterestReview(HashMap<String, Object> map) throws SQLException {
		interestReviewDao.deleteInterestReview(map);
		
	}

	@Override
	public ArrayList<InterestReviewVO> getAllInterestReview(String userId)
			throws SQLException {
		
		return interestReviewDao.getAllInterestReview(userId);
	}

	@Override
	public CompanyReviewVO getOneCompanyReviewById(int companyReviewId)
			throws SQLException {
		
		return companyReviewDao.getOneCompanyReviewById(companyReviewId);
	}

	@Override
	public ArrayList<TrueOrFalseVO> getCompanyReviewVerifyByInterestReview(
			int reviewId) throws SQLException {
		
		return companyReviewVerifyDao.getCompanyReviewVerifyByInterestReview(reviewId);
	}

	@Override
	public void updatePointPlus(HashMap<String, Object> map)
			throws SQLException {
		userDao.updatePointPlus(map);
		
	}

	@Override
	public UserVO getOneUser(HashMap<String, String> map) throws SQLException {
		
		return userDao.getOneUser(map);
	}

	@Override
	public void updatePointMinus(HashMap<String, Object> map)
			throws SQLException {
		// TODO Auto-generated method stub
		userDao.updatePointMinus(map);
	}
	

	
}
